import { _decorator, Animation, Component, director, Node } from 'cc';
import { GLOBALVar } from './GlobalVar';
const { ccclass, property } = _decorator;

@ccclass('MenuManager')
export class MenuManager extends Component {
    @property({type: Node, tooltip: "RankNode"})
    private rankNode: Node = null;
    @property({type: Node, tooltip: "FeedbackNode"})
    private FeedbackNode: Node = null;
    start() {
    }

    update(deltaTime: number) {
        
    }

    onClickRank() {
        this.node.active = false;
        this.rankNode.active = true;
        this.rankNode.getChildByName("RankPanel").getComponent(Animation).play();
    }

    onClickMail() {

    }

    onClickFriend() {

    }

    onClickFeedBack() {
        this.FeedbackNode.active = true;
    }

    onClickBackLogin() {
        //手动注销账号，下次不再自动登录
        localStorage.setItem("isLoginByToken", "false");
        director.loadScene("LoginScene")
    }
}


